<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Freetype OpenGL: Font manager</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="style.css" rel="stylesheet" type="text/css" />



</head>
<body>
<div id="content"><!-- do not remove this div! -->

<div id="top"><!-- do not remove this div! -->

  
  <div id="titlearea">
    
    <div id="projectname">Freetype OpenGL</div>
    
    
    <div id="projectbrief">A high quality OpenGL text rendering engine for C</div>
    
  </div>
  

<!--

<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Freetype OpenGL
   &#160;<span id="projectnumber">0.1</span>
   </div>
   <div id="projectbrief">A high quality OpenGL text rendering engine for C</div>
  </td>
  
  
  
   
  
 </tr>
 </tbody>
</table>
</div>
-->


<!-- Generated by Doxygen 1.8.0 -->
<script type="text/javascript" src="dynsections.js"></script>
</div>
<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Font manager</div>  </div>
</div><!--header-->
<div class="contents">
<hr/><a name="details" id="details"></a><h2>Synopsis</h2>
<p>Structure in charge of caching fonts. </p>
<p><b>Example Usage</b>: </p>
<div class="fragment"><pre class="fragment"><span class="preprocessor"> #include &quot;<a class="code" href="font-manager_8h.html">font-manager.h</a>&quot;</span>

 <span class="keywordtype">int</span> main( <span class="keywordtype">int</span> arrgc, <span class="keywordtype">char</span> *argv[] )
 {
     <a class="code" href="structfont__manager__t.html" title="Structure in charge of caching fonts.">font_manager_t</a> * manager = manager_new( 512, 512, 1 );
     <a class="code" href="structtexture__font__t.html" title="Texture font structure.">texture_font_t</a> * font = font_manager_get( manager, <span class="stringliteral">&quot;Mono&quot;</span>, 12, 0, 0 );

     <span class="keywordflow">return</span> 0;
 }
</pre></div> <table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfont__manager__t.html">font_manager_t</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Structure in charge of caching fonts.  <a href="structfont__manager__t.html#details">More...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga286fd2880d0964d5ae83d1e4b12f4870"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structfont__manager__t.html">font_manager_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__font-manager.html#ga286fd2880d0964d5ae83d1e4b12f4870">font_manager_new</a> (size_t width, size_t height, size_t depth)</td></tr>
<tr class="memdesc:ga286fd2880d0964d5ae83d1e4b12f4870"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a new empty font manager.  <a href="#ga286fd2880d0964d5ae83d1e4b12f4870"></a><br/></td></tr>
<tr class="memitem:gab691d11fa02e2409f6f224f42a753b15"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__font-manager.html#gab691d11fa02e2409f6f224f42a753b15">font_manager_delete</a> (<a class="el" href="structfont__manager__t.html">font_manager_t</a> *self)</td></tr>
<tr class="memdesc:gab691d11fa02e2409f6f224f42a753b15"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deletes a font manager.  <a href="#gab691d11fa02e2409f6f224f42a753b15"></a><br/></td></tr>
<tr class="memitem:ga714764da96215f18f4b48d489cb6b0fb"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__font-manager.html#ga714764da96215f18f4b48d489cb6b0fb">font_manager_delete_font</a> (<a class="el" href="structfont__manager__t.html">font_manager_t</a> *self, <a class="el" href="structtexture__font__t.html">texture_font_t</a> *font)</td></tr>
<tr class="memdesc:ga714764da96215f18f4b48d489cb6b0fb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deletes a font from the font manager.  <a href="#ga714764da96215f18f4b48d489cb6b0fb"></a><br/></td></tr>
<tr class="memitem:ga90765b3292194df83f2260211d678e2e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structtexture__font__t.html">texture_font_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__font-manager.html#ga90765b3292194df83f2260211d678e2e">font_manager_get_from_filename</a> (<a class="el" href="structfont__manager__t.html">font_manager_t</a> *self, const char *filename, const float size)</td></tr>
<tr class="memdesc:ga90765b3292194df83f2260211d678e2e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Request for a font based on a filename.  <a href="#ga90765b3292194df83f2260211d678e2e"></a><br/></td></tr>
<tr class="memitem:gaf18915a9ec531b4959acdd29fea1b0df"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structtexture__font__t.html">texture_font_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__font-manager.html#gaf18915a9ec531b4959acdd29fea1b0df">font_manager_get_from_description</a> (<a class="el" href="structfont__manager__t.html">font_manager_t</a> *self, const char *family, const float size, const int bold, const int italic)</td></tr>
<tr class="memdesc:gaf18915a9ec531b4959acdd29fea1b0df"><td class="mdescLeft">&#160;</td><td class="mdescRight">Request for a font based on a description.  <a href="#gaf18915a9ec531b4959acdd29fea1b0df"></a><br/></td></tr>
<tr class="memitem:gaab7e279a33054137e359e450e2806970"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structtexture__font__t.html">texture_font_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__font-manager.html#gaab7e279a33054137e359e450e2806970">font_manager_get_from_markup</a> (<a class="el" href="structfont__manager__t.html">font_manager_t</a> *self, const <a class="el" href="structmarkup__t.html">markup_t</a> *markup)</td></tr>
<tr class="memdesc:gaab7e279a33054137e359e450e2806970"><td class="mdescLeft">&#160;</td><td class="mdescRight">Request for a font based on a markup.  <a href="#gaab7e279a33054137e359e450e2806970"></a><br/></td></tr>
<tr class="memitem:gad9b4aaa3f225fa3d17dcaef2dd26d617"><td class="memItemLeft" align="right" valign="top">char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__font-manager.html#gad9b4aaa3f225fa3d17dcaef2dd26d617">font_manager_match_description</a> (<a class="el" href="structfont__manager__t.html">font_manager_t</a> *self, const char *family, const float size, const int bold, const int italic)</td></tr>
<tr class="memdesc:gad9b4aaa3f225fa3d17dcaef2dd26d617"><td class="mdescLeft">&#160;</td><td class="mdescRight">Search for a font filename that match description.  <a href="#gad9b4aaa3f225fa3d17dcaef2dd26d617"></a><br/></td></tr>
</table>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="gab691d11fa02e2409f6f224f42a753b15"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="group__font-manager.html#gab691d11fa02e2409f6f224f42a753b15">font_manager_delete</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structfont__manager__t.html">font_manager_t</a> *&#160;</td>
          <td class="paramname"><em>self</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Deletes a font manager. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>a font manager. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga714764da96215f18f4b48d489cb6b0fb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="group__font-manager.html#ga714764da96215f18f4b48d489cb6b0fb">font_manager_delete_font</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structfont__manager__t.html">font_manager_t</a> *&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structtexture__font__t.html">texture_font_t</a> *&#160;</td>
          <td class="paramname"><em>font</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Deletes a font from the font manager. </p>
<p>Note that font glyphs are not removed from the atlas.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>a font manager. </td></tr>
    <tr><td class="paramname">font</td><td>font to be deleted </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gaf18915a9ec531b4959acdd29fea1b0df"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structtexture__font__t.html">texture_font_t</a>* <a class="el" href="group__font-manager.html#gaf18915a9ec531b4959acdd29fea1b0df">font_manager_get_from_description</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structfont__manager__t.html">font_manager_t</a> *&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>family</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const float&#160;</td>
          <td class="paramname"><em>size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const int&#160;</td>
          <td class="paramname"><em>bold</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const int&#160;</td>
          <td class="paramname"><em>italic</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Request for a font based on a description. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>a font manager </td></tr>
    <tr><td class="paramname">family</td><td>font family </td></tr>
    <tr><td class="paramname">size</td><td>font size </td></tr>
    <tr><td class="paramname">bold</td><td>whether font is bold </td></tr>
    <tr><td class="paramname">italic</td><td>whether font is italic</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>Requested font </dd></dl>

</div>
</div>
<a class="anchor" id="ga90765b3292194df83f2260211d678e2e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structtexture__font__t.html">texture_font_t</a>* <a class="el" href="group__font-manager.html#ga90765b3292194df83f2260211d678e2e">font_manager_get_from_filename</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structfont__manager__t.html">font_manager_t</a> *&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>filename</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const float&#160;</td>
          <td class="paramname"><em>size</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Request for a font based on a filename. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>a font manager. </td></tr>
    <tr><td class="paramname">filename</td><td>font filename </td></tr>
    <tr><td class="paramname">size</td><td>font size</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>Requested font </dd></dl>

</div>
</div>
<a class="anchor" id="gaab7e279a33054137e359e450e2806970"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structtexture__font__t.html">texture_font_t</a>* <a class="el" href="group__font-manager.html#gaab7e279a33054137e359e450e2806970">font_manager_get_from_markup</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structfont__manager__t.html">font_manager_t</a> *&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structmarkup__t.html">markup_t</a> *&#160;</td>
          <td class="paramname"><em>markup</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Request for a font based on a markup. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>a font manager </td></tr>
    <tr><td class="paramname">markup</td><td>Markup describing a font</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>Requested font </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="demo-ansi_8c-example.html#a18">demo-ansi.c</a>.</dd>
</dl>
</div>
</div>
<a class="anchor" id="gad9b4aaa3f225fa3d17dcaef2dd26d617"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char* <a class="el" href="group__font-manager.html#gad9b4aaa3f225fa3d17dcaef2dd26d617">font_manager_match_description</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structfont__manager__t.html">font_manager_t</a> *&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>family</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const float&#160;</td>
          <td class="paramname"><em>size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const int&#160;</td>
          <td class="paramname"><em>bold</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const int&#160;</td>
          <td class="paramname"><em>italic</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Search for a font filename that match description. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>a font manager </td></tr>
    <tr><td class="paramname">family</td><td>font family </td></tr>
    <tr><td class="paramname">size</td><td>font size </td></tr>
    <tr><td class="paramname">bold</td><td>whether font is bold </td></tr>
    <tr><td class="paramname">italic</td><td>whether font is italic</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>Requested font filename </dd></dl>

</div>
</div>
<a class="anchor" id="ga286fd2880d0964d5ae83d1e4b12f4870"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structfont__manager__t.html">font_manager_t</a>* <a class="el" href="group__font-manager.html#ga286fd2880d0964d5ae83d1e4b12f4870">font_manager_new</a> </td>
          <td>(</td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>width</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>height</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>depth</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Creates a new empty font manager. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">width</td><td>width of the underlying atlas </td></tr>
    <tr><td class="paramname">height</td><td>height of the underlying atlas </td></tr>
    <tr><td class="paramname">depth</td><td>bit depth of the underlying atlas</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>a new font manager. </dd></dl>

</div>
</div>
</div><!-- contents -->
</div>
</body>
</html>
